package com.lark.wifi.entity;


public class WifiEntry {

    /** Unknown security type. */
    public static final int SECURITY_TYPE_UNKNOWN = -1;
    /** Security type for an open network. */
    public static final int SECURITY_TYPE_OPEN = 0;
    /** Security type for a WEP network. */
    public static final int SECURITY_TYPE_WEP = 1;
    /** Security type for a PSK network. */
    public static final int SECURITY_TYPE_PSK = 2;
    /** Security type for an EAP network. */
    public static final int SECURITY_TYPE_EAP = 3;
    /** Security type for an SAE network. */
    public static final int SECURITY_TYPE_SAE = 4;
    /** Security type for a WPA3-Enterprise in 192-bit security network. */
    public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE_192_BIT = 5;
    /** Security type for an OWE network. */
    public static final int SECURITY_TYPE_OWE = 6;
    /** Security type for a WAPI PSK network. */
    public static final int SECURITY_TYPE_WAPI_PSK = 7;
    /** Security type for a WAPI Certificate network. */
    public static final int SECURITY_TYPE_WAPI_CERT = 8;
    /** Security type for a WPA3-Enterprise network. */
    public static final int SECURITY_TYPE_EAP_WPA3_ENTERPRISE = 9;
    /** Security type for an OSEN network. */
    public static final int SECURITY_TYPE_OSEN = 10;
    /** Security type for a Passpoint R1/R2 network, where TKIP and WEP are not allowed. */
    public static final int SECURITY_TYPE_PASSPOINT_R1_R2 = 11;
    /**
     * Security type for a Passpoint R3 network, where TKIP and WEP are not allowed,
     * and PMF must be set to Required.
     */
    public static final int SECURITY_TYPE_PASSPOINT_R3 = 12;
    /** Security type for Easy Connect (DPP) network */
    public static final int SECURITY_TYPE_DPP = 13;

    /**
     * Do not use OCSP stapling (TLS certificate status extension)
     * @hide
     */
    public static final int OCSP_NONE = 0;

    /**
     * Try to use OCSP stapling, but not require response
     * @hide
     */
    public static final int OCSP_REQUEST_CERT_STATUS = 1;

    /**
     * Require valid OCSP stapling response
     * @hide
     */
    public static final int OCSP_REQUIRE_CERT_STATUS = 2;

    /**
     * Require valid OCSP stapling response for all not-trusted certificates in the server
     * certificate chain
     * @hide
     */
    public static final int OCSP_REQUIRE_ALL_NON_TRUSTED_CERTS_STATUS = 3;

    public static final int CERT_UNSPECIFIED = 0;
    public static final int CERT_SYSTEM = 1;
    public static final int CERT_FIRST_USE = 2;
    public static final int CERT_INSTALL = 3;

    public static final int STATUS_CERT_NOT_VERIFY = 1;
    public static final int STATUS_CERT_NEED_NOT_FORCE = 2;
    public static final int STATUS_CERT_NEED = 3;

    public String SSID;
    public String password;

    // 身份
    public String identity;

    // 匿名身份
    public String anonymousIdentity;

    // 域名
    public String domainSuffixMatch;
    public int securityType;
    public int eapMethod;
    public int phase2Method;

    // CA证书
    public int caCert;

    // 在线证书状态
    public int ocsp;

    public void setCertState(int state) {
        if (state == STATUS_CERT_NOT_VERIFY) {
            ocsp = OCSP_NONE;
        }
        if (state == STATUS_CERT_NEED_NOT_FORCE) {
            ocsp = OCSP_REQUEST_CERT_STATUS;
        }
        if (state == STATUS_CERT_NEED) {
            ocsp = OCSP_REQUIRE_CERT_STATUS;
        }
    }

    public String getPassword() {
        if (password == null) {
            return "";
        }
        return password;
    }

    // [WPA2-PSK-CCMP][RSN-PSK+SAE-CCMP][ESS] = SSID: iPhone (7),
    // capabilities: [WPA2-PSK-CCMP][RSN-PSK+SAE-CCMP][ESS],

    // [WPA2-EAP-CCMP][RSN-EAP-CCMP][ESS] = SSID: CSS Corporate,
    //capabilities: [WPA2-EAP-CCMP][RSN-EAP-CCMP][ESS],

    // [WPA2-EAP-CCMP][RSN-EAP-CCMP][ESS] = SSID: CSS STAFF,
    // capabilities: [WPA2-EAP-CCMP][RSN-EAP-CCMP][ESS],

    // (scanResult.capabilities.contains("EAP/SHA1")
    //                || scanResult.capabilities.contains("EAP/SHA256")
    //                || scanResult.capabilities.contains("FT/EAP")
    //                || scanResult.capabilities.contains("EAP-FILS"))
    //                && !isScanResultForWpa3EnterpriseOnlyNetwork(scanResult)
    //                && !isScanResultForWpa3EnterpriseTransitionNetwork(scanResult);

    // scanResult.capabilities.contains("EAP/SHA256")
    //                && !scanResult.capabilities.contains("EAP/SHA1")
    //                && scanResult.capabilities.contains("RSN")
    //                && !scanResult.capabilities.contains("WEP")
    //                && !scanResult.capabilities.contains("TKIP")
    // scanResult.capabilities.contains("[MFPR]");
    // scanResult.capabilities.contains("[MFPC]");

    // scanResult.capabilities.contains("EAP/SHA1")
    //                && scanResult.capabilities.contains("EAP/SHA256")
    //                && scanResult.capabilities.contains("RSN")
    //                && !scanResult.capabilities.contains("WEP")
    //                && !scanResult.capabilities.contains("TKIP")
    //                && !isScanResultForPmfMandatoryNetwork(scanResult)
    //                && isScanResultForPmfCapableNetwork(scanResult);
}
